< previous page page_199 next page >

Page 199
Command1.ToolTipText = This command button will perform task 1
Command2.ToolTipText = This command button will perform task 2
StatusBar1.Panels(1).ToolTipText = This is the text panel
StatusBar1.Panels(2).ToolTipText = This is the current system date
Before running the application again, add a second panel to the status bar to display the system date. Now, when you execute the application, each object on the form will display the correct information (see Figure 7.27). As you can see, this enables you to create unique messages depending on the function being performed, and additionally have tips displayed for each panel.
12181-0199a.gif
Figure 7.27.
Using ToolTip text to display related information
about an object.
Object Shortcuts
Object shortcuts are a feature that you can add to your application to let the user move directly to any input field on the form. This feature is very familiar to users because it uses the same type of visual interface as the hotkeys in menus and command buttons. The difference in this method is that it uses the Ctrl key instead of the Alt key. To use this feature in your application you must associate a label control with each input control on the form. Figure 7.28 shows an example of two text boxes, a combo box, and a command button that all have a hotkey defined.
12181-0199b.gif
Figure 7.28.
Hotkeys are very useful for
direct navigation within a form or
to execute menu options without using
the mouse.
Now, by adding the following code to your application, every time the control key and the specified letter in the label are pressed, focus is set to the related input field:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (Shift And vbCtrlMask) > 0 Then
       If KeyCode = vbKeyF Then

 
< previous page page_199 next page >

If you like this book, buy it!